package com.bookRecommend.mapper;

import com.bookRecommend.model.Type;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【type(图书类型表)】的数据库操作Mapper
 * @createDate 2022-07-20 21:59:16
 * @Entity .Type
 */
public interface ITypeMapper {

    @Select("select * from type")
    List<Type> selectAllTypes();

    @Select("select * from type")
    List<Type> selectPage();

    @Select("select * from type where id = #{id}")
    Type selectById(Integer id);

    @Delete("delete from type where id = #{id}")
    int deleteById(Integer id);

    @Insert("insert into type(typename) values(#{typeName})")
    int insertType(Type type);

    @Update("update type set typename = #{typeName} where id = #{id}")
    int updateType(Type type);


}




